<?php
namespace Business;


use Business\Activity\EmployeeActivityStrategy;
use Business\Activity\ManagerActivityStrategy;
use Business\Custom\EmployeeCustomStrategy;
use Business\Custom\ManagerCustomStrategy;
use Business\Custom\DirectorCustomStrategy;
use Business\Home\AdminHomeStrategy;
use Business\Home\EmployeeHomeStrategy;
use Business\Home\ManagerHomeStrategy;
use Business\Home\DirectorHomeStrategy;
use Business\Report\EmployeeReportStrategy;
use Business\Report\ManagerReportStrategy;
use Business\Set\AdminSetStrategy;
use Business\Set\ManagerSetStrategy;

/**
 * Created by PhpStorm.
 * User: Emmett
 * Date: 2016/8/30
 * Time: 17:11
 */
class StrategyFactory
{
    public static function create_homePageStrategy($mvc_controller)
    {
        $iHomeStrategy = null;
        $user_auth = session('user_auth');
        switch ($user_auth['role']) {
            case 99:
                $iHomePageStrategy = new AdminHomeStrategy($mvc_controller, $user_auth['role']);
                break;
            case 1:
                $iHomePageStrategy = new EmployeeHomeStrategy($mvc_controller, $user_auth['role']);
                break;
            case 2:
                $iHomePageStrategy = new ManagerHomeStrategy($mvc_controller, $user_auth['role']);
                break;
            case 3:
                $iHomePageStrategy = new DirectorHomeStrategy($mvc_controller, $user_auth['role']);
                break;
            default:
                $iHomePageStrategy = new EmployeeHomeStrategy($mvc_controller);
                break;
        }
        return $iHomePageStrategy;
    }

    public static function create_customStrategy($mvc_controller)
    {
        $iCustomStrategy = null;
        $user_auth = session('user_auth');
        switch ($user_auth['role']) {
            case 1:
                $iCustomStrategy = new EmployeeCustomStrategy($mvc_controller, $user_auth['role']);
                break;
            case 2:
                $iCustomStrategy = new ManagerCustomStrategy($mvc_controller, $user_auth['role']);
                break;
            case 3:
                $iCustomStrategy = new DirectorCustomStrategy($mvc_controller, $user_auth['role']);
                break;
            default:
//                $iCustomStrategy = new EmployeeDebtStrategy($mvc_controller);
                break;
        }
        return $iCustomStrategy;
    }

    public static function create_activityStrategy($mvc_controller)
    {
        $iActivityStrategy = null;
        $user_auth = session('user_auth');
        switch ($user_auth['role']) {
            case 1:
                $iActivityStrategy = new EmployeeActivityStrategy($mvc_controller, $user_auth['role']);
                break;
            case 2:
                $iActivityStrategy = new ManagerActivityStrategy($mvc_controller, $user_auth['role']);
                break;
            case 3:
                break;
            default:
//                $iActivityStrategy = new ManagerActivityStrategy($mvc_controller, $user_auth['role']);
                break;
        }
        return $iActivityStrategy;
    }

    public static function create_settingStrategy($mvc_controller)
    {
        $iSetStrategy = null;
        $user_auth = session('user_auth');
        switch ($user_auth['role']) {
            case 99:
                $iSetStrategy = new AdminSetStrategy($mvc_controller, $user_auth['role']);
                break;
            default:
                $iSetStrategy = new ManagerSetStrategy($mvc_controller, $user_auth['role']);
                break;
        }
        return $iSetStrategy;
    }

    public static function create_reportStrategy($mvc_controller)
    {
        $iReportStrategy = null;
        $user_auth = session('user_auth');
        switch ($user_auth['role']) {
            case 1:
                $iReportStrategy = new EmployeeReportStrategy($mvc_controller, $user_auth['role']);
                break;
            case 2:
                $iReportStrategy = new ManagerReportStrategy($mvc_controller, $user_auth['role']);
                break;
            case 3:
                break;
            default:
                $iReportStrategy = new ManagerReportStrategy($mvc_controller, $user_auth['role']);
                break;
        }
        return $iReportStrategy;
    }
}